#############################
#### REPLICATION PACKAGE ####
#############################

Title: "How Sexuality Affects Evaluations of Immigrant Deservingness and Cultural Similarity: A Conjoint Survey Experiment" 
Authors: Nathan I. Hoffmann and Kristopher Velasco
Journal: Public Opinion Quarterly

#############################

This package replicates the main paper's figures and the entire Online Appendix for "How Sexuality Affects Evaluations of Immigrant Deservingness and Cultural Similarity: A Conjoint Survey Experiment," published in Public Opinion Quarterly. 

We conducted all analyses in R, using RMarkdown (.Rmd) files. To run these replication files, all files should be saved in the same folder.

This package contains the following elements:
1. prolific.csv: the data about respondents collected by Prolific, from which respondents were drawn
2. qualtrics.csv: the conjoint survey data, as processed by Qualtrics
3. main_replication.Rmd: reproduces all of the figures from the main paper
4. appendix_replication.Rmd: reproduces the entire Online Appendix, including figures
5. prolific_codebook.csv: the codebook for the Prolific data
6. qualtrics_codebook.csv: the codebook for the Qualtrics survey data

We also rely on data from Wave 112 of the American Trends Panel, conducted between July 18 and August 21, 2022, saved as "ATP W112.sav". Someone wanting to replicate our results will need to download this file and save it in the same folder as the other replication files. The data and codebook are available on the Pew Research website: https://www.pewresearch.org/internet/dataset/american-trends-panel-wave-112/

#############################

For information on the version of R and the packages we use, here is the output from sessionInfo():

R version 4.3.3 (2024-02-29)
Platform: x86_64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.2.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Los_Angeles
tzcode source: internal

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] lubridate_1.9.3      forcats_1.0.0        stringr_1.5.1        dplyr_1.1.4          purrr_1.0.2         
 [6] readr_2.1.5          tidyr_1.3.1          tibble_3.2.1         ggplot2_3.5.1        tidyverse_2.0.0     
[11] srvyr_1.2.0          survey_4.4-2         survival_3.7-0       Matrix_1.6-5         DeclareDesign_1.0.10
[16] estimatr_1.0.4       fabricatr_1.0.2      randomizr_1.0.0      rdss_1.0.4           cregg_0.4.0         
[21] patchwork_1.2.0      haven_2.5.4          huxtable_5.5.6       here_1.0.1          

loaded via a namespace (and not attached):
 [1] tidyselect_1.2.1     viridisLite_0.4.2    fastmap_1.2.0        TH.data_1.1-2        prediction_0.3.18   
 [6] broom.helpers_1.15.0 digest_0.6.36        timechange_0.3.0     estimability_1.5.1   lifecycle_1.0.4     
[11] magrittr_2.0.3       compiler_4.3.3       rlang_1.1.4          tools_4.3.3          utf8_1.2.4          
[16] yaml_2.3.8           gt_0.10.1            data.table_1.15.4    knitr_1.47           bit_4.0.5           
[21] ggstance_0.3.7       xml2_1.3.6           multcomp_1.4-25      withr_3.0.0          fansi_1.0.6         
[26] xtable_1.8-4         colorspace_2.1-0     gtsummary_1.7.2      emmeans_1.10.2       scales_1.3.0        
[31] MASS_7.3-60.0.1      cli_3.6.3            mvtnorm_1.2-5        rmarkdown_2.27       crayon_1.5.3        
[36] generics_0.1.3       rstudioapi_0.16.0    tzdb_0.4.0           DBI_1.2.3            splines_4.3.3       
[41] parallel_4.3.3       assertthat_0.2.1     mitools_2.4          vctrs_0.6.5          sandwich_3.1-0      
[46] bookdown_0.39        hms_1.1.3            bit64_4.0.5          Formula_1.2-5        systemfonts_1.1.0   
[51] glue_1.7.0           codetools_0.2-20     stringi_1.8.4        gtable_0.3.5         lmtest_0.9-40       
[56] munsell_0.5.1        pillar_1.9.0         rmdfiltr_0.1.3       htmltools_0.5.8.1    R6_2.5.1            
[61] rprojroot_2.0.4      vroom_1.6.5          evaluate_0.24.0      kableExtra_1.4.0     lattice_0.22-6      
[66] backports_1.5.0      dataverse_0.3.14     broom_1.0.6          Rcpp_1.0.13          svglite_2.1.3       
[71] coda_0.19-4.1        xfun_0.45            rticles_0.27         zoo_1.8-12           pkgconfig_2.0.3     